FROM alpine:latest

ENV LANG='en_US.UTF-8' LANGUAGE='en_US:en' LC_ALL='en_US.UTF-8'

LABEL maintainer="leaftea@qq.com"

ENV TZ=Asia/Shanghai

COPY entrypoint.sh /usr/local/bin/

RUN set -x \
    && sed -i 's/dl-cdn.alpinelinux.org/mirrors.aliyun.com/g' /etc/apk/repositories \
    && apk --no-cache add openjdk11-jre tzdata zeromq fontconfig ttf-dejavu curl \
    && ln -snf /usr/share/zoneinfo/$TZ /etc/localtime \
    && echo '$TZ' > /etc/timezone \
    && adduser -S -u 1000 springboot \
    && mkdir -p /app \
    && mkdir -p /logs \
    && chmod +x /usr/local/bin/entrypoint.sh \
    && chown -R springboot /app && chmod -R 777 /app \
    && chown -R springboot /logs && chmod -R 777 /logs

USER springboot

WORKDIR /app

VOLUME ["/app","/logs"]

EXPOSE 8080

ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]